//
//  HLChangePasswordVC.m
//  zhuanxian
//
//  Created by zhaoliang chen on 2017/11/17.
//  Copyright © 2017年 huiling. All rights reserved.
//

#import "HLChangePasswordVC.h"
#import "UITextField+function.h"

@interface HLChangePasswordVC ()

@property(nonatomic,strong)UITextField* textField1;
@property(nonatomic,strong)UITextField* textField2;
@property(nonatomic,strong)UITextField* textField3;

@end

@implementation HLChangePasswordVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self setNavigationTitle:@"修改密码" Color:[UIColor whiteColor]];
    
    UIView* line1 = [self createLine];
    [self.view addSubview:line1];
    [line1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.mas_equalTo(0.6);
        make.left.right.mas_equalTo(self.view);
        make.top.mas_equalTo(20);
    }];
    
    [self.view addSubview:self.textField1];
    [self.textField1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.mas_equalTo(self.view);
        make.top.mas_equalTo(line1.mas_bottom);
        make.height.mas_equalTo(40);
    }];
    
    UIView* line2 = [self createLine];
    [self.view addSubview:line2];
    [line2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.height.mas_equalTo(line1);
        make.top.mas_equalTo(self.textField1.mas_bottom);
    }];
    
    [self.view addSubview:self.textField2];
    [self.textField2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.height.mas_equalTo(self.textField1);
        make.top.mas_equalTo(line2.mas_bottom);
    }];
    
    UIView* line3 = [self createLine];
    [self.view addSubview:line3];
    [line3 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.height.mas_equalTo(line1);
        make.top.mas_equalTo(self.textField2.mas_bottom);
    }];
    
    [self.view addSubview:self.textField3];
    [self.textField3 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.height.mas_equalTo(self.textField1);
        make.top.mas_equalTo(line3.mas_bottom);
    }];
    
    UIView* line4 = [self createLine];
    [self.view addSubview:line4];
    [line4 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.height.mas_equalTo(line1);
        make.top.mas_equalTo(self.textField3.mas_bottom);
    }];
    
    UIButton* btnChangePassword = [UIButton buttonWithType:UIButtonTypeCustom];
    btnChangePassword.backgroundColor = MainColor;
    [btnChangePassword setTitle:@"修改密码" forState:UIControlStateNormal];
    [btnChangePassword setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [btnChangePassword addTarget:self action:@selector(onClickChange) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btnChangePassword];
    [btnChangePassword mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(20);
        make.right.mas_equalTo(-20);
        make.height.mas_equalTo(40);
        make.top.mas_equalTo(line4.mas_bottom).offset(20);
    }];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)onClickChange {
    
}

- (UITextField*)textField1 {
    if (!_textField1) {
        _textField1 = [[UITextField alloc]init];
        _textField1.placeholder = @"请输入旧密码";
        [_textField1 setLeftInset:10];
        _textField1.secureTextEntry = YES;
        _textField1.backgroundColor = [UIColor whiteColor];
        _textField1.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
    }
    return _textField1;
}

- (UITextField*)textField2 {
    if (!_textField2) {
        _textField2 = [[UITextField alloc]init];
        _textField2.placeholder = @"请输入新密码";
        [_textField2 setLeftInset:10];
        _textField2.secureTextEntry = YES;
        _textField2.backgroundColor = [UIColor whiteColor];
        _textField2.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
    }
    return _textField2;
}

- (UITextField*)textField3 {
    if (!_textField3) {
        _textField3 = [[UITextField alloc]init];
        _textField3.placeholder = @"请再次输入新密码";
        [_textField3 setLeftInset:10];
        _textField3.secureTextEntry = YES;
        _textField3.backgroundColor = [UIColor whiteColor];
        _textField3.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
    }
    return _textField3;
}

- (UIView*)createLine {
    UIView* line = [[UIView alloc]init];
    line.backgroundColor = [UIColor lightGrayColor];
    return line;
}


@end
